<template>
  <div>
    <el-container>
      <el-header>
        <div class="tops">
          <div class="ims">
            <div>
              <img src="../assets/20.jpg" alt="">
            </div>
            <h1>在线后台管理系统</h1>
          </div>
          <el-dropdown>
            <span class="el-dropdown-link" color="#fff">
              yangyongqi<i class="el-icon-arrow-down el-icon--right"></i>
            </span>
            <el-dropdown-menu slot="dropdown">
              <el-dropdown-item command="a">个人信息</el-dropdown-item>
              <el-dropdown-item command="b"> <span @click="quit">退出</span></el-dropdown-item>
            </el-dropdown-menu>
          </el-dropdown>
        </div>
      </el-header>
      <!-- 侧边伸缩 -->
      <el-container width="20px" router v-model="isCollapse" style="margin-bottom: 20px;" color="#303133">
        <el-aside height="0" :width="this.isCollapse ? '60px' : '200px'" background-color="#283346" color="#303133">
          <i class="el-icon-s-operation" :label="false" @click="add"></i>
          <el-menu active-text-color="#ffd04b" :router="true" background-color="#324057" color="#303133"
            default-active="1-4-1" class="el-menu-vertical-demo" :collapse="isCollapse">
            <!-- 首页 -->
            <el-menu-item index="/homes" background-color="#545c64" color="#fff">
              <i class="el-icon-s-home" font-size="40px"></i>
              <span slot="title" color="#303133">首页</span>
            </el-menu-item>
            <!-- 资金管理 -->
            <el-submenu index="1">
              <template slot="title">
                <i class="el-icon-eleme"></i>
                <span slot="title">资金管理</span>
              </template>
              <el-menu-item index="/Turnover" background-color="#000" color="#fff">资金流水</el-menu-item>
            </el-submenu>
            <!-- 信息管理 -->
            <el-submenu index="2">
              <template slot="title">
                <i class="el-icon-collection"></i>
                <span slot="title">信息管理</span>
              </template>
              <el-menu-item index="Personal">资金信息</el-menu-item>
            </el-submenu>

            <!-- 中间内容 -->
          </el-menu>
        </el-aside>
        <el-main>

          <router-view> </router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>
<script>
export default {
  data() {
    return {
      isCollapse: false,

    }
  },
  methods: {
    add() {
      this.isCollapse = !this.isCollapse
    },
  // 退出到登录页面
  quit(){
    localStorage.removeItem('token')
    this.$router.push('/login')
    console.log(555);
  }
  }
}
</script>
<style lang="scss" scoped>
.el-dropdown-selfdefine ::v-deep{
  color:'#fff'
}
.el-submenu__title span::v-deep {
  color: #fff;
}

.el-menu-item::v-deep {
  color: #fff;
}

.el-aside.el-header::v-deep {
  color: #fff;
}

.el-header::v-deep {
  padding: 0;
}

element.style {
  width: 0;
}

.el-menu-vertical-demo:not(.el-menu--collapse) {
  // width: 200px;
  min-height: 400px;
}

* {
  padding: 0;
  margin: 0;
}

.el-header,
.el-footer {
  background-color: #B3C0D1;
  color: #333;
  text-align: center;
  line-height: 60px;
  color: #fff;

  .tops {
    width: 100%;
    height: 100%;
    background-color: #324057;
    display: flex;

    .ims {
      width: 80%;
      display: flex;
      margin-left: 30px;

      div {
        width: 50px;
        height: 50px;
        margin-top: 5px;

        img {
          width: 100%;
          height: 100%;
        }
      }

    }
  }
}

.el-aside {
  color: #fff;
  text-align: center;
  // height: 690px;
  background-color: #324057;
}

.el-main {
  background-color: #E9EEF3;
  // color: #fff;
  // text-align: center;
  // line-height: 160px;
  // height: 690px;
  height: 92vh;
}
</style>